home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / nan_news / vol3 / no4 / help.prg < prev    next >
Text File  |  1989-01-01  |  2KB  |  56 lines

  1. * Program: Help.prg
  2. * Author:  Benjo Dans 
  3. * Version: Clipper Summer '87
  4. * Note:    Disk-based help program
  5. * Copyright (c) 1988 Benjo Dans
  6.  
  7. * ... code
  8.  
  9. PARAMETERS call, line, input
  10.  
  11. IF call = "HELP"        && Prevent recursive help
  12.    RETURN               && from within the help program.
  13. ENDIF
  14.  
  15. PRIVATE call, photo, slct, first
  16. PRIVATE mrow, mcol, mkey, maxline, test, curline, scrnline
  17. SAVE SCREEN TO photo
  18.  
  19. slct  = SELECT()        && Remember current work area.
  20. first = .T.             && In case of no find, no redraw.   
  21. mrow  = ROW()           && Store initial row, column pointers.
  22. mcol  = COL()
  23. mkey  =  0              && ASCII value of last key pressed.
  24.  
  25. SELECT 0                              && Open a work area.   
  26. USE Help.dbf                          && Open help file.
  27. GOTO TOP
  28. DO WHILE .NOT. EOF() .AND. mkey <> 27 && Check for <ESC> key. 
  29.    test = Condition                   
  30.    IF &test.                          && Check for condition.
  31.       first   = .F.                   && Set find flag.
  32.       maxline = MLCOUNT(Notes,Width)  && Total memo lines.
  33.       curline =  0                    && current memo line.
  34.  
  35.       * Display help screen(s) routine.
  36.       DO WHILE curline < maxline .AND. mkey <> 27
  37.          FOR scrnline  = 1 TO ;
  38.          IIF(maxline > curline + Lines, Lines, maxline-curline)
  39.              @ Row-1+scrnline, Col SAY ;
  40.                MEMOLINE(Notes, Width, curline+scrnline)
  41.          NEXT
  42.          curline = curline + Lines 
  43.          mkey    = INKEY(0)         && Pause screen.
  44.      ENDDO
  45.   ENDIF
  46.   SKIP
  47. ENDDO
  48. USE                                  && Close help file.
  49. SELECT (slct)                        && Restore work area.  
  50. IF .NOT. first
  51.    RESTORE SCREEN FROM photo         && Restore screen.
  52.    @ mrow, mcol SAY ""               && Restore cursor position.
  53. ENDIF
  54. RELEASE ALL
  55. RETURN
  56.